package com.zpark.cloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

/**
 * @PackageName: com.zpark.cloud.controller
 * @ClassName: ProviderController
 * @Description:
 * @author: RZS
 * @date: 2023/6/19  11:40
 */
@RestController
@RequestMapping("/eureka_client_provider")
public class ProviderController {

    @Value("${spring.application.name}")
    private String serverName;
    @Value("${server.port}")
    private String serverPort;

    @GetMapping("/test")
    public String test(){
        return "<h1>欢迎访问！访问的服务名字："+serverName+"，访问服务端口号："+serverPort;
    }

    @GetMapping("/a/{id}")
    public String testA(@PathVariable("id") Integer id){
        return "<h1>访问的服务名字："+serverName+"，访问服务端口号："+serverPort + ", 参数ID：" + id;
    }

    @PostMapping("/login")
    public String testB(String username, String pwd){
        return "<h1>访问的服务名字："+serverName+"，访问服务端口号："+serverPort + ", 参数username：" + username + ", pwd：" + pwd;
    }
}
